<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>CSS Test: Parsing check for * ~ :root error handling</title>
      <style type="text/css">
          * ~ :root div
          {
            color: red;
          }
          div
          {
            color: green;
          }
      </style>
    </head>
    <body>
      <p>The test passes if the Filler Text is green.</p>
      <div id="test">Filler Text</div>
      <div id="testresult" style="color: blue">Running</div>
      <script type="text/javascript">
          function ArrayContains(array, value, ci)
          {
              ci = ci == true ? true : false;
              for (var i = 0; i < array.length; i++)
              {
                  if (ci && array[i].toLowerCase() == value.toLowerCase())
                  {
                      return true;
                  }
                  else if (array[i] == value)
                  {
                      return true;
                  }
              }
              return false;
          }
        function TestCase()
        {
            try
            {
                  var greenValues = new Array("green", "#008000", "rgb(0, 128, 0)");

                  var elem = document.getElementById("test");
                  var val = getComputedStyle(elem, null).getPropertyValue("color");
                  if (ArrayContains(greenValues, val, false))
                  {
                      document.getElementById("testresult").innerHTML = "Pass";
                      return;
                  }
            }catch(e){}
            document.getElementById("testresult").innerHTML = "Fail";
        }
        TestCase();
    </script>
    </body>
</html>